#ifndef __BSP_OLED_IO_H__
#define __BSP_OLED_IO_H__

/*uint8_t uint32_t... define*/
#include <stdint.h>

/*__STATIC_INLINE define */
#include "cmsis_compiler.h"
//#define __STATIC_INLINE static inline
                
void bsp_oled_io_init(void);
void bsp_oled_io_write_cmd_async(uint8_t cmd,const uint8_t *param,uint32_t len);
void bsp_oled_io_write_ram_async(const uint8_t *pData,uint32_t len,uint32_t repeatCnt);

__STATIC_INLINE void bsp_oled_io_write_cmd_sync(uint8_t cmd,const uint8_t *param,uint32_t len)
{
  extern volatile uint32_t g_u4OLED_SPI_TX_Done;  
  
  bsp_oled_io_write_cmd_async(cmd,param,len);
  /*Wait complete*/
  while (g_u4OLED_SPI_TX_Done == 0){;}
}

__STATIC_INLINE void bsp_oled_io_write_ram_sync(const uint8_t *pData,uint32_t len,uint32_t repeatCnt)
{
  extern volatile uint32_t g_u4OLED_SPI_TX_Done;  
  
  bsp_oled_io_write_ram_async(pData,len,repeatCnt);
  /*Wait complete*/
  while (g_u4OLED_SPI_TX_Done == 0){;} 
}

__STATIC_INLINE uint32_t bsp_oled_iO_async_complete(void)
{
  extern volatile uint32_t g_u4OLED_SPI_TX_Done;  
  
  return g_u4OLED_SPI_TX_Done;
}


#endif